<script lang="ts" setup name="CapitalAccount">
import {useRouter} from 'vue-router';
const router = useRouter();
const handleBack=()=>{
  router.go(-1)
}
</script>
<template>
  <div class="capital-account">
    <nav-header class="header" title='' >
      <template #left>
        <div></div>
      </template>
      <template #right>
        <img @click="handleBack" class="header-rigth" src="@/assets/images/icon/icon-close.png"/>
      </template>
    </nav-header>
    <div class="content">
      <div class="content-virtual-profit">
        <div class="virtual-profit">
          <div class="welcome">
            <div class='tip'>
              <div class='tip2'>虚拟投资组合价值</div>
            </div>
          </div>
          <div class="money">
            <div class='money-total'><span class="symbol">$</span>99,928.53</div>
            <div class='money-rate'>
              <img src="@/assets/images/icon/icon-home-funded-rate-red.png" alt="">
              -71.47(-0.36%)
            </div>
          </div>
        </div>
        <div class='info'>
          <van-cell border title="总投资额" value="$20,000.00"/>
          <van-cell title="可用现金" value="$80,000.00"/>
        </div>
        <div class="btns">
          <van-button
              class='btn-submit-out'
              type="default"
          >
            出金
          </van-button>
          <van-button
              class='btn-submit-in'
              type="primary"
          >
            入金
          </van-button>
        </div>
      </div>
    </div>
    <div class='deliver-4'></div>
    <div class="content">
     <div class="list">
        <div class="list-item" v-for="(item,index) in [1,2]">
          <van-cell title="" is-link>
             <template #title>
               <img class="currencies-img" src="@/assets/images/icon/icon-list-yindu.png" alt="">
               <span class="title-text"><span class="city">印股</span>/卢比-0088(10)</span>
             </template>
          </van-cell>
          <div class="today">
            <div class="label">资产净值</div>
            <div class="value">今日盈亏</div>
          </div>
          <div class="money">
            <div class="label">100,000.00</div>
            <div class="value">+194.14</div>
          </div>
          <div :class="['rate',index==0?'colorGreen':'colorRed'] ">
            <div class="value">-0.17%</div>
          </div>
        </div>
     </div>
    </div>
  </div>
</template>
<style lang="scss" scoped>
.capital-account{
  .header{
      .header-rigth{
        width: 10px;
        padding: 5px;
      }
  }
  .content{
    padding: 10px;
    .content-virtual-profit {
      box-sizing: border-box;
      .virtual-profit {
        margin-top: 10px;
        display: flex;
        flex-direction: column;
        .welcome {
          display: flex;
          align-items: center;
          justify-content: space-between;

          .tip {
            display: flex;
            flex-direction: column;

            .tip2 {
              font-weight: 400;
              font-size: 8px;
              color: #777777;
            }
          }

          .icon {
            img {
              width: 16px;
            }
          }
        }

        .money {
          margin-top: 3px;
          display: flex;
          flex-direction: column;

          &-total {
            font-weight: bold;
            font-size: 16px;
            color: #1642F4;
            display: flex;
            align-items: center;

            span {
              font-weight: 600;
              font-size: 12px;
              color: #1642F4;
            }
          }

          &-rate {
            font-size: 7px;
            color: #E8464A;
            display: flex;
            justify-content: flex-start;
            align-items: center;
            img{
              width: 4px;
              margin-right: 2px;
            }
          }
        }
      }

      .info {
        margin-top: 8px;
      }

      :deep(.van-cell) {
        padding-left: 0;
        padding-right: 0;

        .van-cell__title {
          font-size: 7px;
          color: #777777;
        }

        .van-cell__value {
          font-size: 7px;
          color: #2C2C2C;
          font-weight: bold;
        }
      }

      .btns{
        display: flex;
        margin-top: 5px;
        .btn-submit-out{
          flex: 1;
          color: #1642F4;
          margin-right: 10px;
          border-radius: 100px;
          font-size: 8px;
          line-height: 1;
        }
        .btn-submit-in{
          flex: 1;
          border-radius: 100px;
          background: #1642F4;
          font-size: 8px;
          border: none;
          line-height: 1;
        }
      }



    }
    .list{
      &-item{
        margin-top: 6px;
        padding-bottom:4px;
        position: relative;
        &::after{
          content: '';
          position: absolute;
          width: 100%;
          height:1px;
          background: #ddd;
          bottom: 0;
          left: 0;
        }
        &:last-child{
          &::after{
            display: none;
          }
        }
        :deep(.van-cell){
          padding: 0;
          &::after{
            display: none;
          }
          .van-cell__title{
            display: flex;
            align-items: center;
            .currencies-img{
              width: 15px;
              margin-right: 2px;
            }
            .title-text{
              font-size: 8px;
              color: #000000;
              line-height: 1;
              .city{
                font-weight: bold;
              }
            }
          }
        }
        .today,.money,.rate{
          display: flex;
          justify-content: space-between;
        }
        .today{
          margin-top: 6px;
          .label,.value{
            font-size: 7px;
            line-height: 1;
            color: #777777;
          }
        }
        .money{
           margin-top: 4px;
           align-items: center;
          line-height: 1;
           .label{
             font-weight: bold;
             font-size: 10px;
             color: #000000;
           }
          .value{
            font-weight: bold;
            font-size: 8px;
            color: #2C2C2C;
          }
        }
        .rate{
          margin-top: 4px;
          justify-content: flex-end;
          font-size:7px;
          color: #5FAB3D;
          font-weight: bold;
        }
      }
    }
  }
  .deliver-4 {
    width: 100%;
    height: 4px;
    background: #F6F6F6;
  }

}
</style>
